/*
 * @Description: 单位导航包裹组件
 * @Author: Rfan
 * @Date: 2022-02-10 13:40:29
 * @LastEditTime: 2022-09-08 14:30:35
 */

import { useArchivalCodeContext } from '../contexts/ArchivalCodeContext';
import FondsNav from '@/components/FondsNav';
import ATNav from '@/components/ATNav';

const FondsSidebar = () => {
  const { selectFond, setSelectFond, setSelectAT } = useArchivalCodeContext();

  const handleChange = (id: number, item: any) => {
    console.log('change', id, item);

    setSelectFond(item);
  };
  const handleATChange = (id: number, item: any) => {
    console.log('at change', id, item);
    setSelectAT(item);
  };

  return (
    <>
      <FondsNav onChange={handleChange} />
      <ATNav activeFond={selectFond.id} onChange={handleATChange} />
    </>
  );
};

export default FondsSidebar;
